﻿using QMERP.SeedWork;

namespace QMERP.Domain.Entities
{
    /// <summary>
    /// 客户
    /// </summary>
    public class Customer : FullEntity<long>
    {
        public Customer() 
        {
            Contract_Customers = new HashSet<Contract_Customer>();
        }
        /// <summary>
        /// 客户级别字符串
        /// </summary>
        public string? Level { get; set; }
        /// <summary>
        /// 父Id
        /// </summary>
        public long? PId { get; set; }
        /// <summary>
        /// 客户Code
        /// </summary>
        public string Code { get; set; } = "";
        /// <summary>
        /// 客户名称
        /// </summary>
        public string Name { get; set; } = "";
        /// <summary>
        /// 客户简称
        /// </summary>
        public string? ShortName { get; set; } = "";
        /// <summary>
        /// 客户地址
        /// </summary>
        public string? Address { get; set; }
        /// <summary>
        /// 客户账户地址
        /// </summary>
        public string? BillingAddress { get; set; }
        /// <summary>
        /// 电话号码
        /// </summary>
        public string? Telephone { get; set; }
        // <summary>
        /// 传真
        /// </summary>
        public string? Fax { get; set; }
        /// <summary>
        /// 邮箱
        /// </summary>
        public string? Email { get; set; }
        /// <summary>
        /// 地区代码
        /// </summary>
        public string? AreaCode { get; set; }
        /// <summary>
        /// 交易代码
        /// </summary>
        public string? TradeCode { get; set; }
        /// <summary>
        /// 邮政编码
        /// </summary>
        public string? PostCode { get; set; }
        /// <summary>
        /// 银行
        /// </summary>
        public string? Bank { get; set; }
        /// <summary>
        /// 银行账号
        /// </summary>
        public string? BankAccount { get; set; }
        /// <summary>
        /// 免税代码
        /// </summary>
        public string? TaxCode { get; set; }
        /// <summary>
        /// 税率
        /// </summary>
        public decimal? TaxRate { get; set; }
        /// <summary>
        /// 支付方式
        /// </summary>
        public string? PayCode { get; set; }
        /// <summary>
        /// 货币代码
        /// </summary>
        public string? CurrencyCode { get; set; }
        /// <summary>
        /// 代表人
        /// </summary>
        public string? Signer { get; set; }
        /// <summary>
        /// 条形码
        /// </summary>
        public string? BarCode { get; set; }
        /// <summary>
        /// 关系类型
        /// </summary>
        public string? ContactType { get; set; }
        /// <summary>
        /// 信用等级
        /// </summary>
        public string? CreditGrade { get; set; }
        /// <summary>
        /// 信用货币
        /// </summary>
        public decimal? CreditMoney { get; set; }
        /// <summary>
        /// 特殊折扣
        /// </summary>
        public int? SpecialDiscount { get; set; }
        /// <summary>
        /// 参考代码
        /// </summary>
        public string? ReferenceCode { get; set; }
        /// <summary>
        /// 客户转换代码
        /// </summary>
        public string? ConvertCusCode { get; set; }
        /// <summary>
        /// 承运方式
        /// </summary>
        public string? TransferWayCode { get; set; }
        /// <summary>
        /// 货税代码
        /// </summary>
        public string? FreightTaxCode { get; set; }
        /// <summary>
        /// 是否显示价格
        /// </summary>
        public bool IsShowPrice { get; set; } = false;
        /// <summary>
        /// 对账代码
        /// </summary>
        public string? AccountCode { get; set; }
        /// <summary>
        /// 组织机构Id
        /// </summary>
        public long? OrganizationId { get; set; }
        /// <summary>
        /// 组织机构
        /// </summary>
        public virtual Organization? Organization { get; set; }
        /// <summary>
        /// 合约绑定的客户列表
        /// </summary>
        public virtual ICollection<Contract_Customer> Contract_Customers { get; set; }
    }
}
